#!/usr/bin/env python
# -*- coding: utf-8 -*-
from inspect import *

try:
    getfullargspec  # New in Python 3.0 (getargspec was deprecated).
                    # 3to2 has a fixer for this (fullargspec) but it
                    # should be disabled.

    FullArgSpec  # Namedtuple returned by getfullargspec.

except NameError:
    from adm._compatibility._collections import namedtuple
    FullArgSpec = namedtuple('FullArgSpec', 'args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations')

    def getfullargspec(func):
        # On Python 2.x, the three additional Python 3 specific items
        # (kwonlyargs, kwonlydefaults, annotations), are set to None.
        args, varargs, varkw, defaults = getargspec(func)
        kwonlyargs, kwonlydefaults, annotations = None, None, None
        argspec = FullArgSpec(args, varargs, varkw, defaults,
                              kwonlyargs, kwonlydefaults, annotations)
        return argspec
